public class Lc_JD4 {
    class Solution {
        public int kthToLast(ListNode head, int k) {
            ListNode fast = head;
            ListNode slow = head;
            int count = 0;
            while(count != k - 1) {
                fast = fast.next;
                count++;
            }
            while(fast.next != null) {
                slow = slow.next;
                fast = fast.next;
            }
            return slow.val;
        }
    }

    public static void main(String[] args) {

    }
}
